﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;

namespace SHA
{
    class SHA
    {
        static void Main(string[] args)
        {
            FileStream file = new FileStream("../../sunset.pdn", FileMode.Open);
            using (file)
            {
                SHA1 sha = new SHA1CryptoServiceProvider();
                byte[] buf = new byte[4096];
                while (true)
                {
                    int bytesRead = file.Read(buf, 0, buf.Length);
                    if (bytesRead == 0)
                    {
                        break;
                    }
                    foreach (var item in sha.ComputeHash(buf, 0, buf.Length))
                    {
                        Console.WriteLine(item);
                    }
                }
            }
        }
    }
}
